{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=4
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
   i,n,m,k,l,r,c:longint;
   a:array[0..10010] of longint;
 
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
read(n,m);
for i:=1 to n do read(a[i]);
for i:=1 to m do begin
    read(k);
    l:=1;
    r:=n;
    while r-l>1 do begin
          c:=(l+r) div 2;
          if a[c]<k then l:=c else
          if a[c]>k then r:=c else break;
    end;
    c:=(l+r) div 2;
    if (a[c]=k) or (a[l]=k) or (a[r]=k) then writeln('YES') else writeln('NO');
end;
end.